package com.itheima.mall.controller;

import com.itheima.mall.pojo.CompanyAddress;
import com.itheima.mall.service.OmsCompanyAddressService;
import com.itheima.mall.vo.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/companyAddress")
public class OmsCompanyAddressController {

    @Autowired
    private OmsCompanyAddressService omsCompanyAddressService;

    /**
     * 获取所有收货地址
     */
    @GetMapping("/list")
    public ResponseEntity<List<CompanyAddress>> getList(){
        List<CompanyAddress> list = omsCompanyAddressService.getList();
        return ResponseEntity.ok(list);
    }


}
